﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;  

public partial class ReportPages_AlphabeticalListOfProductsReport : System.Web.UI.Page
{
    private void RefreshReport()
    {
        AccessDataSource1.DataBind();
  
        // Create two parameters for display of the selected date range.
        ReportParameter[] parameters = new ReportParameter[2];
        ReportParameter reportParameterDateFrom = new ReportParameter("DateFrom", this.dateFromTextBox.Text , false);
        ReportParameter reportParameterDateTo = new ReportParameter("DateTo", this.dateToTextBox.Text, false);
        parameters[0] = reportParameterDateFrom;
        parameters[1] = reportParameterDateTo;
        // Add the two parameters to the report.
        ReportViewer1.LocalReport.SetParameters(parameters);

        this.ReportViewer1.LocalReport.Refresh();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
            RefreshReport(); 
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RefreshReport(); 

    }
}
